<?php
  $catorsec = $this->show_fp;
  if ($catorsec==1) {
    $seclink   = JRoute::_(JanewsHelperRoute::getCategoryRoute($rows[0]->catslug, $rows[0]->sectionid, $rows[0]->cattitle, $rows[0]->sectitle));  
	}elseif ($catorsec==0) {
		$seclink   = JRoute::_(JanewsHelperRoute::getSectionRoute($rows[0]->sectionid, $rows[0]->sectitle));
	}
	$sectitle = ($catorsec==1) ? $rows[0]->cattitle:$rows[0]->sectitle;
	$secdesc = ($catorsec==1) ? $rows[0]->catdesc:$rows[0]->secdesc;

	$cls_sufix = trim($params->get('blog_theme',''));
	if($cls_sufix) $cls_sufix = '-'.$cls_sufix;
?>
	<div class="jazin-boxwrap jazin-theme<?php echo $cls_sufix;?>">
	<div class="jazin-box">
<?php if ($showcattitle == 1): ?>
	<div class="jazin-section clearfix" >
		<a href="<?php echo $seclink;?>" title="<?php echo trim(strip_tags($secdesc));?>">
			<span><?php echo $sectitle;?></span>
		</a>
	</div>
<?php endif; ?>
<?php
	$i = 0;
	while($i < $introitems && $i<count($rows)) {
		$row = $rows[$i];
		$link   = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
		$image = JaNewsHelper::replaceImage ($row, $img_align, $autoresize, $maxchars, $showimage, $img_w, $img_h, $hiddenClasses );
		//Show the latest news
?>
		<div class="jazin-content clearfix">
			<h4 class="jazin-title"><a href="<?php echo $link;?>" title="<?php echo strip_tags($row->title);?>"><?php echo $row->title;?></a></h4>
			<?php echo $image; ?>
			<?php //echo ($maxchars?$row->introtext1:$row->introtext);?>
			<?php 
				     if($maxchars > strlen($row->introtext)) {
				      echo $row->introtext;
				     } else {
				      echo $row->introtext1;
				     }
				?>
			<?php if ($showreadmore) {?>
    	<a href="<?php echo $link;?>" class="readon"><?php echo JText::_('READ MORE...');?></a>
    	<?php } ?>
		</div>
		<span class="article_separator">&nbsp;</span>
<?php
		$i++;
	}
	
	if (count ($rows) > $i) {
		echo "<strong class=\"jazin-more\">"; echo JText::_('MORE:'); echo "</strong>\n";
		echo "<ul class=\"jazin-links\">\n";
		
		while (count ($rows) > $i) {
			$row = $rows[$i];
			$link   = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid.":testset"));
?>
			<li>
			
			<img src="<?php echo $this->baseurl . '/images/bullet_arrow_red.gif'?>" hspace="6" alt="" />
			<a title="<?php //echo htmlentities(strip_tags($row->introtext)); ?>" href="<?php echo $link; ?>">
			<?php echo $row->title; ?></a>
			</li>
<?php
			$i++;
		}
		echo "</ul>\n";
	} 
?>
	</div>
	</div>